home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
clnfil23.zip
/
CLEANFIL.DOC
next >
Wrap
Text File
|
1991-02-16
|
17KB
|
468 lines
C L E A N - F I L E S
═════════════════════
(c) Copyright 1990,91 by Klaus Hartnegg,
D-7835 Teningen, Germany
Description:
────────────
Every time DOS writes a file it fills up the last used cluster with some
randomly collected data. CleanFile wipes out this unused data space
without affecting the file itself. This ensures that you don't
inadvertently publish confidential data when giving away some program-
or data files on diskettes.
New Features?
─────────────
If you already have an older version of this program you should at least
read the section 'revision history' near the end of this text.
Requirements
────────────
CleanFile only uses MS-DOS calls to do its work and BIOS for screen
output. It does not use the FAT or any internal data structure of DOS
and should thus run on all types of drives and all versions of DOS from
3.0 on upwards.
Licence
───────
This software is provided as-is, without warranty of any kind. The
author shall not be liable to the user for any direct, indirect or
consequential loss arising from the use of, or inability to use, any
program or file howsoever caused. No warranty is given that the software
will work under all circumstances.
This software may be distributed free of charge as long as all files
except the key-file are distributed together. The key-file is proof of
your registration and must not be given to other persons.
You may use this program for a 7 day trial period without payment. If
you decide to use it longer than this trial period, you have to pay a
registration fee of $15 (US-$).
The registered version may be used either by one person or on one single
computer only.
Background
──────────
Space on all disks (hard disk or floppy) is split into sectors.
Depending on the size of the disk a sector contains 256, 512 or 1024
characters. DOS can not write single characters but only complete
sectors. Space on disks used for your files is allocated in even bigger
units: clusters. A Cluster contains either 2, 4 or 8 sectors.
Very little files happen to need an exact multiple of the cluster size.
When writing a file, DOS fills up the rest of the last sector with some
randomly chosen data that happened to be in one of its internal buffers.
The unused sectors of the last cluster simply retain their previous
content. DOS's internal buffers contain data or disk directories that
you worked on just before.
Imagine what that means: every time you gave a diskette away you
included some private or maybe even confidential data, that you perhaps
didn't really want to publish, even when using a freshly formatted
diskette!
You say `nobody can look at this data'? Oh yes, they can! It's in fact
very easy: there are a lot of programs called `sector editors' that
allow doing exactly this. Perhaps the most popular examples for such
programs are Norton's wonderful utilities NU or DISKEDIT. Of course they
were not written to serve this dubious purpose; instead they are
intended to repair defective disks and do indeed a very good job of
this.
What CleanFile does
───────────────────
CleanFile overwrites every character that exist beyond the end of your
files with nulls. CleanFile will not only overwrite the rest of the last
sector but also all unneeded sectors in the last cluster. This will not
affect the content of your file.
Please note that CleanFile does not prevent DOS from doing the error
described above. It can only correct the problem after it already
occurred. Thus it won't help to run CleanFile on the files on your hard
disk that you intend to copy to a disk because the problem arises when
you actually are copying the files. So you'll have to clean all
destination files after every COPY or XCOPY! I am sorry, but that's the
way DOS works!
You may want to use CleanFile not only on diskettes but also on hard
disks when several people share a computer. In this case you will need
an additional program to wipe out the completely unused data space too.
Usage
─────
Supply the names of the files and/or directories that shall be cleaned
as parameters on the command-line.
You may press Ctrl-Break at any time to abort the processing. CleanFile
will respond with a short beep but will not stop immediately - it has to
close all open files first.
Syntax : CleanFil [/Options] [filename(s)]
filename(s):
one ore more names of files and/or directories. Filenames may contain
wildcard characters '?' and '*'. These wildcards will be handled in
the usual way, NOT like extended wildcards in filenames that you
supply after the exclude switch (see below)!
Alternatively CleanFile can read the names of the files and/or
directories to work on from the standard-input device. To use this
you should know what redirection of input and output and pipes are.
Please read your DOS manual for a description of these.
Options: (Options can be supplied in any order)
/R - recurse into subdirectories (registered versions only!)
This will cause CleanFil to work not only on the files in the current
or specified directory but also in all subdirectories and in all
directories within these subdirectories and so on.
/hid - include hidden files
Cleanfile will process files with the hidden attribute set only when
you specify this option. Read the section 'possible problems' below
before using this option!
/sys - include system files
Cleanfile will process files with the system attribute set only when
you specify this option. Read the section 'possible problems' below
before using this option!
/today - process only files that have been changed today.
/D<date> - process only files that have been changed at or after the
specified date.
Run CleanFile without any arguments to find out in which format the
date has to be written. The format depends on the country for which
your computer has been installed. If the date format is not what you
expected then a line is missing or invalid in the file CONFIG.SYS.
For example in Germany one has to write 'country = 49,437'. No such
redefinition may be necessary in the USA.
/X<filename> - Exclude all files that match the given filename.
You can supply many filenames separated by blanks if you put the
whole string into ' or ". Example: cleanfil *.* '/x*.bak /x*.dat'
This is however not necessary, because you can as well supply the /x
switch multiple times. There is only one restriction and this is one
of DOS not of CleanFile: The whole thing has to fit on the command
line!
Please note that the wildcard-handling for the exclude switch is a
very special one: The names of all found files will be expanded to
full path names including the drive letter and a colon before checking
against the supplied filenames to be excluded. The filenames you
supply may contain wildcard characters: a '?' matches one character
or nothing, a '*' matches any string. Important: you can include many
'?' and '*' characters!
By the way, I said '*' matches ANY STRING. Is '\COMPILER\TP60' a
string? YES! So 'c:*\*.pas' will of course match the filename
'c:\compiler\tp60\cleanfil.pas'!!
There are two cases handled a bit special to ensure that cleanfile
always does what you expect. Otherwise these masks would not match
any file at all:
1. a mask containing a filename only, no path (i.e. no '\' character)
will automatically be preceded by '*\'.
2. a mask starting with '\' will automatically be preceded by '?:'
Some other examples:
this pattern will match
*\test.* all files with name 'test'
*\test*.* all files with name starting with 'test'
*\*test*.* all files with the string 'test' somewhere in the name!
test.* (will be translated to *\test.*, see 1st example!)
*\temp\*.* all files in all 'temp' directories